package org.softmed.rest.generation.suites;

import java.util.HashMap;
import java.util.Map;

import org.softmed.rest.generation.HandlerSuite;

import com.google.inject.Inject;
import com.google.inject.name.Named;

public class HandlerSuiteManager {

	@Inject
	@Named("DefaultHandlerSuite")
	static HandlerSuite defaultSuite;

	static Map<String, HandlerSuite> suitesByName = new HashMap<String, HandlerSuite>();

	public static void clear() {
		suitesByName.clear();
	}

	public static void register(String name, HandlerSuite suite) {
		suitesByName.put(name, suite);
	}

	public static HandlerSuite getSuite(String name) {
		return suitesByName.get(name);
	}

	public static Map<String, HandlerSuite> getSuitesByName() {
		return suitesByName;
	}

	public static HandlerSuite getDefaultSuite() {
		return defaultSuite;
	}

	public static void setDefaultSuite(HandlerSuite defaultSuite) {
		HandlerSuiteManager.defaultSuite = defaultSuite;
	}

}
